package cn.kpi.dao.sys;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.kpi.common.persistence.MyBatisDao;
import cn.kpi.entity.sys.RoleEntity;
import cn.kpi.entity.sys.RoleMenuEntity;
import cn.kpi.entity.sys.RoleOrgEntity;
import cn.kpi.entity.sys.RoleUserEntity;

@MyBatisDao
public interface RightsDao {
	public List<RoleEntity> GetRoleList(@Param("where") String where) throws Exception;
	public List<RoleEntity> GetRoleListLimit(@Param("where") String where,@Param("beginrow")int beginrow,@Param("endrow")int endrow) throws Exception;
	public int GetRoleListLimitCount(@Param("where") String where) throws Exception;
	
	public List<RoleUserEntity> GetRoleUserList(@Param("where") String where,@Param("roleid") Long roleid)throws Exception;
	public int DeleteRoleUser(@Param("roleid") Long roleid)throws Exception;
	public int InsertRoleUserBatch(@Param("list")List<Long> list,@Param("roleid") Long roleid)throws Exception;
	public int InsertRoleUser(@Param("userid") Long userid,@Param("roleid") Long roleid)throws Exception;
	
	public List<RoleMenuEntity> GetRoleMenuList(@Param("roleid") Long roleid)throws Exception;
	public int DeleteRoleMenu(@Param("roleid") Long roleid)throws Exception;
	public int InsertRoleMenuBatch(@Param("list")List<Long> list,@Param("roleid") Long roleid)throws Exception;
	
	public List<RoleOrgEntity> GetRoleOrgList(@Param("roleid") Long roleid)throws Exception;
	public int DeleteRoleOrg(@Param("roleid") Long roleid)throws Exception;
	public int InsertRoleOrgBatch(@Param("list")List<Long> list,@Param("roleid") Long roleid)throws Exception;
	
	public int DeleteRoleUserByUserid(@Param("roleid") Long roleid,@Param("userid") Long userid)throws Exception;
	
	public int DeleteAllRoleUserByUserid(@Param("userid") Long userid)throws Exception;
}
